<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div style='width:600px;height:400px'></div>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/echarts/4.8.0/echarts.min.js'></script>
  <script>
    let pieData = [{ name: 'taobao', value: 1111 }, { name: 'jd', value: 231 }, { name: '唯品会', value: 748 }, { name: '1号店', value: 989 }, { name: '聚美优品', value: 6700 }]
    var mycharts = echarts.init(document.querySelector('div'))
    var option = {
      title: {
        text: '平台数据消费情况',
        textStyle: {
          color: 'black'
        }
      },
      series: [
        {
          type: 'pie',
          data: pieData,
          //文字显示
          label: {
            //显示文字
            show: true,
            //文字显示内容
            formatter: function (params) {
              return params.name + '平台' + params.value + '元\n' + params.percent + '%'
            }
          },
          // radius: 20 半径设置,
          // radius: '20%' //宽度和高度中较小的那一半,
          // radius: ['50%', '75%'], //第0个元素代表的是内圆的半径,第1个元素外圆的半径
          roseType: 'radius',
          //选中效果
          selectedMode: 'single'
        }
      ],
    }
    mycharts.setOption(option)
  </script>
</body>
<!-- https://www.bilibili.com/video/BV1bh41197p8?p=21 -->

</html>